# -*- coding: utf-8 -*-
"""
date: Fri Dec 14 14:40:41 2018
python: Anaconda 3.6.5
author: kanade
email: kanade@blisst.cn
"""
import matplotlib.pyplot as mp


# 生成数据
values = [26, 17, 21, 29, 11]
spaces = [0.05, 0.01, 0.01, 0.01, 0.01]
labels = ['Python', 'JavaScript', 'C++', 'Java', 'PHP']
colors = ['dodgerblue', 'orangered', 'limegreen', 'violet', 'gold']
# 创建图形窗口
mp.figure('Pie', facecolor='lightgray')
# 设置窗口标题
mp.title('Pie', fontsize=20)
# 绘制饼图
mp.pie(values, spaces, labels, colors, '0.%d',
       shadow=True, startangle=90)
# 设置纵横比为1:1
mp.axis('equal')
# 显示图形
mp.show()
